﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.ServiceModel.Activation;

namespace WeiboPushService
{
    [DataContract]
    public class UserProfile
    {
        [DataMember]
        public string UserID;

        [DataMember]
        public string AccessToken;

        [DataMember]
        public string AccessSecret;

        [DataMember]
        public string PushChannel;

        [DataMember]
        public uint UpdateIntervalInMinutes;
    }

    [ServiceContract(Namespace = "")]
    [SilverlightFaultBehavior]
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class PushService 
    {
        [OperationContract]
        public bool Register(UserProfile userProfile)
        {
            return InternalPushService.Singleton.RegisterOrChange(userProfile);
        }

        [OperationContract]
        public void UnRegister(string userID)
        {
            InternalPushService.Singleton.UnRegister(userID);
        }

        [OperationContract]
        public bool IsRegistered(string userID)
        {
            return false;
        }
    }
}
